#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class xz
{
public:
	int removeDuplicates(vector<int>& nums)
	{
		if (!nums.size())
		{
			return 0;
		}
		int fast = 1, slow = 0;
		while (fast < nums.size())
		{
			if (nums[fast] == nums[slow])
			{
				++fast;
			}
			else
			{
				++slow;
				nums[slow] = nums[fast];
				++fast;
			}
		}
		return slow+1;
	}
};

int main()
{
	vector<int> v;
	v.push_back(1);
	v.push_back(1);
	v.push_back(2);
	v.push_back(5);
	v.push_back(5);
	v.push_back(6);

	xz z;
	int len = z.removeDuplicates(v);
	cout << len << endl;

	return 0;
}

